<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
DRA Systems: OR-Objects 1.2.4: Class  MPSReader
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../drasys/or/mp/util/MPSWriter.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MPSReader.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.io.Reader">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
drasys.or.mp.util</FONT>
<BR>
Class  MPSReader</H2>
<PRE>
java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.BufferedReader
              |
              +--<B>drasys.or.mp.util.MPSReader</B>
</PRE>
<HR>
<DL>
<DT>public class <B>MPSReader</B><DT>extends java.io.BufferedReader<DT>implements <A HREF="../../../../drasys/or/mp/util/ProblemReaderI.html">ProblemReaderI</A></DL>

<P>
Inputs a mathematical programming problem from an
<a href="../../../html/mps.html">MPS</a>
stream.
There are two predominate versions of the MPS format.
An older format that uses fixed field records and a newer
format that uses white-space delimited records.
The fixed record format limits row/column names to eight characters
and the delimited format allows names of arbitrary length.
An MPS reader that reads delimited records can read fixed records
with no changes if the row/column names don't contain embedded spaces. 
This class reads records using the newer delimited format which allows
it to read both MPS versions. If the stream contains a NAME record it
will be read into the 'lp.name' metadatum. 

<P><FONT COLOR="#CC0000"><FONT SIZE=+1>References:</FONT></FONT><FONT SIZE=+1></FONT><P><B><A NAME="0716715872"HREF="http://www.amazon.com/exec/obidos/ISBN=0716715872/opsresearchcomA/" TARGET="amazon.com">Linear Programming</A></B><BR>&nbsp;&nbsp;&nbsp;&nbsp;Vasek Chvatal / Paperback / Published 1983<BR><B><A NAME="047182819X"HREF="http://www.amazon.com/exec/obidos/ISBN=047182819X/opsresearchcomA/" TARGET="amazon.com">Integer and Combinatorial Optimization</A></B><BR>&nbsp;&nbsp;&nbsp;&nbsp;George L. Nemhauser, Laurence A. Wolsey / Paperback / Published 1988<BR><B><A NAME="0471283665"HREF="http://www.amazon.com/exec/obidos/ISBN=0471283665/opsresearchcomA/" TARGET="amazon.com">Integer Programming</A></B><BR>&nbsp;&nbsp;&nbsp;&nbsp;Laurence A. Wolsey / Hardcover / Published 1998<BR>
<P>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="fields_inherited_from_class_java.io.Reader"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class java.io.Reader</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>lock</CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../drasys/or/mp/util/MPSReader.html#MPSReader(java.io.Reader)">MPSReader</A></B>(java.io.Reader&nbsp;in)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../drasys/or/mp/util/MPSReader.html#MPSReader(java.io.Reader, int)">MPSReader</A></B>(java.io.Reader&nbsp;in,
          int&nbsp;sz)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../drasys/or/mp/util/MPSReader.html#parseComment(drasys.or.mp.SizableProblemI, int, java.lang.String)">parseComment</A></B>(<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A>&nbsp;problem,
             int&nbsp;lineNumber,
             java.lang.String&nbsp;line)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is called to parse comment lines.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../drasys/or/mp/util/MPSReader.html#parseLine(drasys.or.mp.SizableProblemI, int, java.lang.String)">parseLine</A></B>(<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A>&nbsp;problem,
          int&nbsp;lineNumber,
          java.lang.String&nbsp;line)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is called to parse each line in the 'MPS' stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../drasys/or/mp/util/MPSReader.html#readProblem(drasys.or.mp.SizableProblemI)">readProblem</A></B>(<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A>&nbsp;problem)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses the 
<a href="../../../html/mps.html">MPS</a>
stream and puts the data into 'problem'.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.io.BufferedReader"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.io.BufferedReader</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>close, 
mark, 
markSupported, 
read, 
read, 
readLine, 
ready, 
reset, 
skip</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.io.Reader"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.io.Reader</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>read</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, 
equals, 
finalize, 
getClass, 
hashCode, 
notify, 
notifyAll, 
toString, 
wait, 
wait, 
wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="MPSReader(java.io.Reader)"><!-- --></A><H3>
MPSReader</H3>
<PRE>
public <B>MPSReader</B>(java.io.Reader&nbsp;in)</PRE>
<DL>
</DL>
<HR>

<A NAME="MPSReader(java.io.Reader, int)"><!-- --></A><H3>
MPSReader</H3>
<PRE>
public <B>MPSReader</B>(java.io.Reader&nbsp;in,
                 int&nbsp;sz)</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="readProblem(drasys.or.mp.SizableProblemI)"><!-- --></A><H3>
readProblem</H3>
<PRE>
public <A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A> <B>readProblem</B>(<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A>&nbsp;problem)
                            throws java.io.IOException,
                                   <A HREF="../../../../drasys/or/mp/SyntaxException.html">SyntaxException</A></PRE>
<DL>
<DD>Parses the 
<a href="../../../html/mps.html">MPS</a>
stream and puts the data into 'problem'.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../../drasys/or/mp/util/ProblemReaderI.html#readProblem(drasys.or.mp.SizableProblemI)">readProblem</A> in interface <A HREF="../../../../drasys/or/mp/util/ProblemReaderI.html">ProblemReaderI</A></DL>
</DD>
</DL>
<HR>

<A NAME="parseLine(drasys.or.mp.SizableProblemI, int, java.lang.String)"><!-- --></A><H3>
parseLine</H3>
<PRE>
public boolean <B>parseLine</B>(<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A>&nbsp;problem,
                         int&nbsp;lineNumber,
                         java.lang.String&nbsp;line)
                  throws java.io.IOException,
                         <A HREF="../../../../drasys/or/mp/DuplicateException.html">DuplicateException</A>,
                         <A HREF="../../../../drasys/or/mp/SyntaxException.html">SyntaxException</A>,
                         <A HREF="../../../../drasys/or/mp/NotFoundException.html">NotFoundException</A>,
                         <A HREF="../../../../drasys/or/mp/InvalidException.html">InvalidException</A></PRE>
<DL>
<DD>This method is called to parse each line in the 'MPS' stream.
It can be overridden to customize line parsing.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>'false' to stop reading or 'true' to continue reading.</DL>
</DD>
</DL>
<HR>

<A NAME="parseComment(drasys.or.mp.SizableProblemI, int, java.lang.String)"><!-- --></A><H3>
parseComment</H3>
<PRE>
public boolean <B>parseComment</B>(<A HREF="../../../../drasys/or/mp/SizableProblemI.html">SizableProblemI</A>&nbsp;problem,
                            int&nbsp;lineNumber,
                            java.lang.String&nbsp;line)
                     throws <A HREF="../../../../drasys/or/mp/SyntaxException.html">SyntaxException</A></PRE>
<DL>
<DD>This method is called to parse comment lines.
It can be overridden to customize comment parsing.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>'false' to stop reading or 'true' to continue reading.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../drasys/or/mp/util/MPSWriter.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MPSReader.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.io.Reader">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
Copyright(C)1997-2000 by DRA Systems all rights reserved. <A HREF=http://OpsResearch.com TARGET=HOME>OpsResearch.com</A>
</BODY>
</HTML>
